/**
 * Created by hxpeng on 2017/3/24.
 */
(function () {
    'use strict';

    angular.module('App.common')
        .directive('ngFileSelect', ngFileSelect);

    /**
     * input file 选择文件触发
     * @returns {{link: link}}
     */
    function ngFileSelect() {
        return {
            link: function($scope,el){
                el.bind("change", function(e){
                    $scope.file = (e.srcElement || e.target).files[0];
                    $scope.getFile();
                })
            }
        }
    }

})();